package aa.jx.register.model;

import java.util.Date;

public class User {
    private int id;
    private String username;
    private String password;
    private String phone;
    private int role;
    private Date birthday;
    private int sex;
    private int del;
    private String name;
    private String payword;
    private String email;
    private String verificationCode;

    // 添加token字段
    private String token;

    // Getter和Setter
    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public User() {}

    // Getters and Setters
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public int getDel() {
        return del;
    }

    public void setDel(int del) {
        this.del = del;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPayword() {
        return payword;
    }

    public void setPayword(String payword) {
        this.payword = payword;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getVerificationCode() {
        return verificationCode;
    }

    public void setVerificationCode(String verificationCode) {
        this.verificationCode = verificationCode;
    }
    public User filterSensitiveInfo() {
        User filteredUser = new User();
        filteredUser.setId(this.id);
        filteredUser.setUsername(this.username);
        filteredUser.setPhone(this.phone);
        filteredUser.setRole(this.role);
        filteredUser.setBirthday(this.birthday);
        filteredUser.setSex(this.sex);
        filteredUser.setName(this.name);
        filteredUser.setEmail(this.email);
        // 不返回密码和支付密码等敏感信息
        return filteredUser;
    }
}